//
//  PraiseTableViewCell.m
//  CarHome
//
//  Created by 王建男 on 14-9-26.
//  Copyright (c) 2014年 WJN_work@163.com. All rights reserved.
//

#import "PraiseTableViewCell.h"

@implementation PraiseTableViewCell

- (void)dealloc
{
    [_annotatedGauge release];
    [_annotatedGauge_1 release];
    _annotatedGauge = nil;
    _annotatedGauge_1 = nil;
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self creatView];
    }
    return self;
}

#pragma mark -
#pragma mark creatView

- (void)creatView
{
    //第三方 图表
    
    self.annotatedGauge = [[MSAnnotatedGauge alloc] initWithFrame:CGRectMake(0, 0, 160, 100)];
    
    //最大值 最小值
    
    _annotatedGauge.minValue = 0.00;
    _annotatedGauge.maxValue = 5.00;
    
    _annotatedGauge.startRangeLabel.text = @"0.00";
    _annotatedGauge.endRangeLabel.text = @"5.00";
    
    _annotatedGauge.fillArcStrokeColor = [UIColor colorWithRed:.41 green:.76 blue:.73 alpha:1];
    _annotatedGauge.fillArcFillColor = [UIColor colorWithRed:.41 green:.76 blue:.73 alpha:1];
    [self.contentView addSubview:_annotatedGauge];
    [_annotatedGauge release];
    
    self.annotatedGauge_1 = [[MSAnnotatedGauge alloc] initWithFrame:CGRectMake(160, 0, 160, 100)];
    _annotatedGauge_1.minValue = 0.00;
    _annotatedGauge_1.maxValue = 5.00;
    _annotatedGauge_1.startRangeLabel.text = @"0.00";
    _annotatedGauge_1.endRangeLabel.text = @"5.00";
    
    _annotatedGauge_1.fillArcStrokeColor = [UIColor colorWithRed:.41 green:.76 blue:.73 alpha:1];
    _annotatedGauge_1.fillArcFillColor = [UIColor colorWithRed:.41 green:.76 blue:.73 alpha:1];
    
        [self.contentView addSubview:_annotatedGauge_1];
    [_annotatedGauge_1 release];
    
}


#pragma mark -
#pragma mark 设置评分 -- 表一

- (void)setgauge:(NSMutableDictionary *)gauge
{
     _annotatedGauge.titleLabel.text = [gauge objectForKey:@"name"];
    [UIView animateWithDuration:2 animations:^{
        
        _annotatedGauge.value = [[gauge objectForKey:@"grade"] floatValue];
        
    } completion:^(BOOL finished) {
        
    }];
}

#pragma mark -
#pragma mark 设置评分 -- 表二

- (void)setgauge_1:(NSMutableDictionary *)gauge
{
    _annotatedGauge_1.titleLabel.text = [gauge objectForKey:@"name"];
    [UIView animateWithDuration:2 animations:^{
        
        _annotatedGauge_1.value = [[gauge objectForKey:@"grade"] floatValue];
        
    } completion:^(BOOL finished) {
        
    }];

}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
